<!DOCTYPE html>
<html lang="en">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<title>团队成员</title>
<script src="<%=basePath%>weixin/js/jquery.min.js"></script>
<script src="<%=basePath%>weixin/js/mui.min.js"></script>
<link rel="stylesheet" href="<%=basePath%>weixin/css/mui.min.css" />
<script src="<%=basePath%>weixin/js/page/common.js"></script>
<link rel="stylesheet" href="<%=basePath%>weixin/css/base.css" />
<link rel="stylesheet" href="<%=basePath%>weixin/css/style.css" />
</head>
<body class="bg-f5">
	<div class="container-box search-box m-top-20">
		<input type="text" id="searchParam" onblur="searchMerberParam();" placeholder="搜索" value="${srm.searchParam}"/>
	</div>
	<div class="container-box m-top-20">
		<div class="row-box">
			<c:set var="indexgroup" value="0" />
			<c:forEach items="${lists}" var="var" varStatus="s">
				<c:if test="${s.index == 0}">
					<div class="location" bind="${indexgroup}">${var[srm.groupParamName]}</div>
				    <div class="input-group bg-white data-member input-group-arrow " data="${indexgroup}">
				</c:if>
				<c:if test="${s.index > 0 && var[srm.groupParam] != lists[s.index - 1][srm.groupParam] }">
					</div> <!-- 此结束标签 & 必须 -->
					<c:set var="indexgroup" value="${indexgroup+1}" />
					<div class="location" bind="${indexgroup}">${var[srm.groupParamName]}</div>
					<div class="input-group bg-white data-member input-group-arrow " data="${indexgroup}">
				</c:if>
					<div class="input-group-item">
						<div class="input-group-img">
							<img src="<%=basePath%>${var.imgpath}" onerror="this.src='<%=basePath%>weixin/img/p.png'" />
						</div>
						<div class="input-group-text">
							<a href="<%=basePath%>api/wx/user/members/detail?userId=${var.user_id}&userType=${var.user_type}">
								<p class="text-color-1a member-name">${var.nickname}</p>
								<p class="member-phone">手机号码：${var.tel}</p>
								<p class="member-time">加入时间：${var.addtime}</p>
							</a>
						</div>
					</div>
			</c:forEach>
		</div>
		<div style="width:100%;vertical-align: middle;padding:10px 0;text-align: center;color:rgb(123,123,123);
				background-color:#fff; border-top:1px solid rgb(233,233,233) ">没有更多数据!</div>
	</div>
	<script>
		(function(mui){
			common.init('member');
		})(mui);

		function searchMerberParam (){
			var searchParam = $("#searchParam").val();
			window.location.href = "<%=basePath%>/api/wx/user/members/list?searchParam="+searchParam;
		}

		function ajaxSearchParam(){
			var searchParam = $("#searchParam").val();
			$.ajax({
				type:"POST",
				url:"<%=basePath%>api/wx/search/member",
				data:{
					'searchParam' : searchParam,
					'tm':new Date().getTime()
				},
				dataType:'json',
				cache: false,
				async: false,
				success: function(data){
					if(data.code==1){
						var jsonArr = eval("("+data.data+")");
						var html_content = "";
						for(var i = 0 ; i < jsonArr.length;i++){
							var _html_str = " <div class=\"input-group-item\"> " +
							" <div class=\"input-group-img\">" +
									" <img src=\"<%=basePath%>"+jsonArr[i].imgpath+ "\" onerror=\"this.src='<%=basePath%>weixin/img/p.png'\" /> "+
									" </div> " +
									"<div class=\"input-group-text\">"+
									"<a href=\"<%=basePath%>api/wx/user/members/detail?userId="+jsonArr[i].user_id+ "&userType="+jsonArr[i].user_type+"\"> "+
									"<p class=\"text-color-1a member-name\">"+jsonArr[i].nickname+"</p> " +
									"<p class=\"member-phone\">手机号码："+jsonArr[i].tel+"</p> " +
							"<p class=\"member-time\">加入时间："+jsonArr[i].addtime+"</p> " +
							"</a>"+
							"</div>"+
							"</div> ";
							html_content += _html_str;
						}
						$(".input-group-arrow").html(html_content);
					}
				}
//				, error: function(XMLHttpRequest, textStatus, errorThrown) {
//					alert(XMLHttpRequest.status+" | "+XMLHttpRequest.readyState+"|"+textStatus);
//				}
			});
		}
	</script>
</body>
</html>